package cn.edu.scau.cmi.chenxiaoqin.client.total;

import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.image.ImageView;
import javafx.scene.image.Image;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Pane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class totalClient extends Application{

	@Override
	public void start(Stage primaryStage) throws Exception {
		// TODO Auto-generated method stub
		
		HBox pane = new HBox();
				
		VBox Left = new VBox(15);
		Left.setPadding(new Insets(15,15,15,15));
		ImageView image = new ImageView(new Image("imag/imag.png"));
		Label id = new Label("学号：201727010102");
		Label name = new Label("姓名：陈晓钦");
		Left.getChildren().addAll(image,id,name);
		
		
		
		
		VBox Right = new VBox(15);
		Right.setPadding(new Insets(15,15,15,15));
		Right.setAlignment(Pos.TOP_CENTER);
		Button bt1 = new Button("实验基础");
		Button bt2 = new Button("单例/多例模式");
		Button bt3 = new Button("简单工厂模式");
		Button bt4 = new Button("工厂模式");
		Button bt5 = new Button("抽象工厂模式");
		Button bt6 = new Button("适配器模式");
		Button bt7 = new Button("一致性组合模式");
		Button bt8 = new Button("安全组合模式");
		Button bt9 = new Button("DI/ORM模式");
		Right.getChildren().addAll(bt1,bt2,bt3,bt4,bt5,bt6,bt7,bt8,bt9);
		bt1.setOnAction(e->{
			InterProgrammingClient ex1 = new InterProgrammingClient();
			ex1.show();
		});
		bt2.setOnAction(e->{
			SingletonClient ex2 = new SingletonClient();
			try
			{
				ex2.start(new Stage()); 
			} 
			catch (Exception e1)
			{
				e1.printStackTrace();
			}
		});
		bt3.setOnAction(e->{
			simpleFactoryMethodClient ex3 =new simpleFactoryMethodClient();
			try
			{
				ex3.start(new Stage()); 
			} 
			catch (Exception e1)
			{
				e1.printStackTrace();
			}
		});
		bt4.setOnAction(e->{
			FactoryClient ex4 =new FactoryClient();
			try
			{
				ex4.start(new Stage()); 
			} 
			catch (Exception e1)
			{
				e1.printStackTrace();
			}
		});
		bt5.setOnAction(e->{
			AbstractFactoryClient ex5 =new AbstractFactoryClient();
			try
			{
				ex5.start(new Stage()); 
			} 
			catch (Exception e1)
			{
				e1.printStackTrace();
			}
		});
		bt6.setOnAction(e->{
			AdapterClient ex6 =new AdapterClient();
			try
			{
				ex6.start(new Stage()); 
			} 
			catch (Exception e1)
			{
				e1.printStackTrace();
			}
		});
		bt7.setOnAction(e->{
			ConsistentCompositeClient ex7 =new ConsistentCompositeClient();
			try
			{
				ex7.start(new Stage()); 
			} 
			catch (Exception e1)
			{
				e1.printStackTrace();
			}
		});
		bt8.setOnAction(e->{
			SafeCompositeClient ex8 =new SafeCompositeClient();
			try
			{
				ex8.start(new Stage()); 
			} 
			catch (Exception e1)
			{
				e1.printStackTrace();
			}
		});
		bt9.setOnAction(e->{
			SpringClient ex9 =new SpringClient();
			try
			{
				
				ex9.start(new Stage()); 
			} 
			catch (Exception e1)
			{
				e1.printStackTrace();
			}
		});
		pane.getChildren().add(Left);
		pane.getChildren().add(Right);
		Scene scene =new Scene(pane,400,440);
		primaryStage.setTitle("综合性实验");
		primaryStage.setScene(scene);
		primaryStage.show();
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Application.launch(args);
	}
}
